/**
    @project {
        "templateId": "org.helgoboss.custom",
        "version": "0.1-SNAPSHOT",
        "dependencies": [
            "org.scala-lang:scala-library:2.9.0-1",
            "org.helgoboss:scala-additions:0.1-SNAPSHOT",
            "org.helgoboss:ide-api:0.1-SNAPSHOT",
            "org.helgoboss:osgi-additions:0.1-SNAPSHOT"
        ]
    }
*/
package org.helgoboss.ide_clipboard_impl

import org.helgoboss.osgi_additions._
import org.helgoboss.ide._
import java.io.File
import java.awt.datatransfer._
import java.awt._

class Activator extends OsgiProvider {
    whenBundleActive {
        (new ClipboardIde).providesService[Ide]
    }
}

class ClipboardIde extends Ide {
    def openProject(projectDir: File) {
        val c = new StringSelection(projectDir.getAbsolutePath)
        Toolkit.getDefaultToolkit.getSystemClipboard.setContents(c, c)
    }
}